let arr = [
    {id: 1, name: 's1'},
    {id: 2, name: 's2'},
    {id: 3, name: 's3'},
    {id: 4, name: 's4'}
];

let arr1 = [];

function arrayMap() {
    return arr.map((value, index) => {
        return value.id;
    });
}
//arr1 = [...arrayMap()];
//console.log(arr1);

function addProperty() {
    for(let le of arr) {
        le.qq = '123';
    }
}
//addProperty();
//console.log(arr)


function includesMethod() {
    let arr2 = [1, 3, 4];
    console.log(arr2.includes(1));
    console.log(arr2.includes("1"));
    console.log(arr2.includes(2));
    console.log(arr2.includes(3));
    console.log(arr2.includes(4));
    console.log(arr2.includes(1, 1));
}

// includesMethod();

function demoTest() {
    let a1 = null;
    let a2 = 0;
    let a3 = '';
    let a4 = undefined;
    let a5 = false;

    console.log(a1 ?? 'default');
    console.log(a2 ?? 'default');
    console.log(a3 ?? 'default');
    console.log(a4 ?? 'default');
    console.log(a5 ?? 'default');

    console.log("------");

    console.log(a1 || 'default');
    console.log(a2 || 'default');
    console.log(a3 || 'default');
    console.log(a4 || 'default');
    console.log(a5 || 'default');
}

demoTest();